using System.Collections.Generic;
using System.Linq;
using UnityEngine;

[CreateAssetMenu(fileName = "Effect33-为目标恢复对应攻击的血量，自身扣除对应的血量", menuName = "Skill/Effect/Effect33-为目标恢复对应攻击的血量，自身扣除对应的血量", order = 33)]
public class Effect33 : EffectBase
{
    public override void Apply(Pair pair, GameEvent e, List<Chess> targets)
    {
        if(targets == null || targets.Count == 0) return;

        foreach (var chess in targets)
        {
            var detailHealth = chess.chessDate.health - chess.ChessDetail.OriginalHp;
            chess.HealOriginHp(detailHealth);
            pair.Chess.Damage(detailHealth);
        }
    
    }
}